#include <bits/stdc++.h>
#define int long long
using namespace std;

const int N = 1e5 + 5;
int arr[N];
int diff[N];

signed main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int n, q;
	cin >> n >> q;
	for (int i=1; i<= n;i++) {
		cin >> arr[i];
	}
	
	// 求差分数组
	for (int i=1;i<=n;i++) {
		diff[i] = arr[i] - arr[i-1];
	}
	
	for (int i=1; i<= q;i++) {
		int l, r, c;
		cin >> l >> r >> c;
		// 区间 + c
		diff[l] += c;
		diff[r+1] -= c;
	}
	
	// 求前缀和
	for (int i=1;i<=n;i++) {
		arr[i] = arr[i-1] + diff[i]; // 把 arr 数组看作新的 prefix 数组
	}
	
	for (int i=1; i<=n;i++) {
		cout << arr[i] << " \n"[i==n];
	}
	return 0;
}
